home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 50
/
Volume 50 - JOGO DISK .iso
/
Games
/
moonstonemadness.swf
/
scripts
/
__Packages
/
ExplodableObstacle.as
< prev
next >
Wrap
Text File
|
2007-09-27
|
869b
|
38 lines
class ExplodableObstacle extends SideScroller.StaticObject
{
function ExplodableObstacle(__mcRef, __oLayer)
{
super(__mcRef,__oLayer);
this.setState("Idle");
}
function onHit(__oRef)
{
if(this.__get__CurrentState() == "Idle")
{
TakGround(__oRef).doReactCollision();
this.__get__ParentLayer().doAddListener(this);
this.setState("Explode");
this.doLockState();
}
}
function doDestroy()
{
this.__get__ParentLayer().doRemoveListener(this);
super.doDestroy();
}
function doExplode()
{
if(this.isStateComplete())
{
if(!this.mcRef.bStateAfterExplosion)
{
this.doDestroy();
}
else
{
this.doForcedSetState("ExplodedIdle");
}
}
}
}